﻿using Dapper;
using System;
using BCEntity.Trading.Enquiry.SaleEnquiry;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Trading.Enquiry.SaleEnquiry
{
    /// <summary>
    /// 销售询盘
    /// </summary>
    public interface ISaleEnquiryData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘Id</param>
        Task<bool> Exists(long saleEnquiryId);
        /// <summary>
        /// 增加销售询盘
        /// </summary>
        /// <param name="entity">销售询盘信息</param>
        Task<SaleEnquiryEntity> Add(SaleEnquiryEntity entity);
        /// <summary>
        /// 更新销售询盘
        /// </summary>
        /// <param name="entity">销售询盘信息</param>
        Task<SaleEnquiryEntity> Update(SaleEnquiryEntity entity);
        /// <summary>
        /// 删除销售询盘
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘Id</param>
        Task<bool> Delete(long saleEnquiryId);
        /// <summary>
        /// 获取销售询盘
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘Id</param>
        Task<SaleEnquiryEntity> GetEntity(long saleEnquiryId);
        /// <summary>
        /// 获取销售最新询盘
        /// </summary>
        /// <param name="phone">用户联系方式</param>
        Task<SaleEnquiryEntity> GetLatestEntity(string phone);
        /// <summary>
        /// 获取销售询盘分页列表
        /// </summary>
        /// <param name="adminId">接待人Id</param>
        /// <param name="userName">用户姓名</param>
        /// <param name="phone">用户联系方式</param>
        /// <param name="companyName">公司名称</param>
        /// <param name="weChatNo">微信号</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<SaleEnquiryEntity>, int)> Query(long? adminId, string userName,string phone,string companyName,string weChatNo, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 获取销售询盘分页列表
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<SaleEnquiryEntity>, int)> Query(long userId, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}